﻿@model BrnMall.Web.MallAdmin.models.DistributionProductSetListModel
@section header{
	<title>分销商品设置</title>
	<link type="text/css" rel="stylesheet" href="/admin_mall/content/css/site.css"/>
	<script type="text/javascript" src="/admin_mall/scripts/jquery.js"></script>
	<script type="text/javascript" src="/admin_mall/scripts/showlist.js"></script>
	<link rel="stylesheet" type="text/css" href="/admin_mall/content/jbox/Skins/Default/jbox.css"/>
	<script type="text/javascript" src="/admin_mall/content/jbox/jquery.jBox-2.3.min.js"></script>
	<script type="text/javascript" src="/admin_mall/scripts/selectlist.js"></script>
	<script type="text/javascript" src="/admin_mall/scripts/product.js"></script>
	<script src="/admin_mall/scripts/distributionproductset.js"></script>
	<script type="text/javascript">
		productPageType = 2;
	</script>
}
@section body{
	<h1 class="rightH1">
		分销管理 &gt;&gt; 分销商品设置
		<div class="clear">
		</div>
	</h1>
	@using (Html.BeginForm())
	{
		<input type="hidden" value="@Model.SortColumn" id="sortColumn" name="sortColumn"/>
		<input type="hidden" value="@Model.SortDirection" id="sortDirection" name="sortDirection"/>
		<div class="dataListSearch">
			<table height="32">
				<tbody>
				<tr>
					<td width="35"><img id="searchImg" src="/admin_mall/content/images/search1.gif"/></td>
					<td>商品店铺：</td>
					<td width="100">
						<div class="selectBt">
							<input type="button" value="@Model.StoreName" onclick="openStoreSelectLayer(this)" style="height: 22px; line-height: 22px; background: url(/admin_mall/content/images/selectbgico.gif) no-repeat 6px center; padding-left: 22px; padding-right: 10px;"/>
							<input type="hidden" class="StoreId" id="StoreId" name="StoreId" value="@Model.StoreId"/>
							<input type="hidden" class="StoreName" id="StoreName" name="StoreName" value="@Model.StoreName"/>
						</div>
					</td>
					<td>商品分类：</td>
					<td width="100">
						<div class="selectBt">
							<input type="button" value="@Model.CategoryName" onclick="openCategorySelectLayer(this)" style="height: 22px; line-height: 22px; background: url(/admin_mall/content/images/selectbgico.gif) no-repeat 6px center; padding-left: 22px; padding-right: 10px;"/>
							<input type="hidden" class="CateId" id="CateId" name="CateId" value="@Model.CateId"/>
							<input type="hidden" class="CategoryName" id="CategoryName" name="CategoryName" value="@Model.CategoryName"/>
						</div>
					</td>
					<td>商品品牌：</td>
					<td width="80">
						<div class="selectBt">
							<input type="button" value="@Model.BrandName" onclick="openBrandSelectLayer(this)" style="height: 22px; line-height: 22px; background: url(/admin_mall/content/images/selectbgico.gif) no-repeat 6px center; padding-left: 22px; padding-right: 10px;"/>
							<input type="hidden" class="BrandId" id="BrandId" name="BrandId" value="@Model.BrandId"/>
							<input type="hidden" class="BrandName" id="BrandName" name="BrandName" value="@Model.BrandName"/>
						</div>
					</td>
					<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;商品名称：</td>
					<td width="180">@Html.TextBox("ProductName", Model.ProductName, new {height = "28", size = "30"})</td>
					<td><input id="SearchProduct" name="SearchProduct" type="image" class="searchBut submit" src="/admin_mall/content/images/s.jpg"/></td>
				</tr>
				</tbody>
			</table>
		</div>
		<div class="dataList">
			<table style="width: 100%; text-align: center;">
				<thead>
				<tr>
					<th width="50%">商品名称</th>
					<th width="5%">成本价</th>
					<th width="5%">商城价</th>
					<th width="5%">分成方式</th>
					<th width="5%">分成值</th>
					<th width="5%">分成金额</th>
					<th width="5%">分销商品</th>
					<th>操作</th>
				</tr>
				</thead>
				<tbody>
				@if (Model.InfoList != null)
				{
					foreach (var info in Model.InfoList)
					{
						<tr>
							<td align="left">@info.ProductName</td>
							<td>@info.CostPrice</td>
							<td>@info.ShopPrice</td>
							@if (info.Id == 0)
							{
								<td>未设置</td>
								<td>未设置</td>
							}
							else
							{
								<td>
									<select class="pumpedType">
										<option value="@DistributionProductPumpedType.Fixed" @(info.PumpedType == DistributionProductPumpedType.Fixed ? "selected=selected" : "")>固定</option>
										<option value="@DistributionProductPumpedType.Percentage" @(info.PumpedType == DistributionProductPumpedType.Percentage ? "selected=selected" : "")>百分比</option>
									</select>
								</td>
								<td><input class="pumpedValue" type="number" value="@info.PumpedValue"/></td>
							}
							<td>@info.PumpedMoney</td>
							<td>@(info.Id > 0 ? "是" : "否")</td>
							<td>
								<a class="editOperate cancelDistribution" style="display:@(info.Id>0?"inherit":"none")" href="javascript:" setId="@info.Id">[取消分销]</a>
								<a class="editOperate saveSet" style="display:@(info.Id>0?"inherit":"none")" href="javascript:" setId="@info.Id" productId="@info.ProductId">[保存设置]</a>
								<a class="editOperate distribution" style="display:@(info.Id==0?"inherit":"none")" href="javascript:" productId="@info.ProductId">[分销]</a>
							</td>
						</tr>
					}
				}
				</tbody>
			</table>
		</div>
		<div class="dataListEdit">
			<div class="page">
				@Html.MallAdminPager(Model.PageModel)
			</div>
		</div>
	}
}
